package com.yicong.ants.bean.video;

import android.graphics.drawable.Drawable;
import android.widget.TextView;

import com.cchao.simplelib.core.UiHelper;
import com.yicong.ants.R;

import java.util.ArrayList;
import java.util.List;

/**
 * @author glj
 * @version 2021/3/9 0009
 */
public class VideoCommentBean {

    /**
     * comment_id : 1
     * nickname : 测试
     * avatar : https://ss3.bdstatic.com/70cFv8Sh_Q1YnxGkpoWK1HF6hhy/it/u=1986451467,394304688&fm=26&gp=0.jpg
     * content : 54353
     * like : 0
     * reply : 0
     * created_at : 2021-03-09
     * like_text : 0
     * is_like : false
     */

    private String comment_id;
    private String nickname;
    private String avatar;
    private String content;
    private int like;
    private int reply;
    private String created_at;
    private String like_text;
    private boolean is_like;
    private boolean is_newComment; //是否是新评论
    private List<VideoCommentBean> replyBeanList;

    public List<VideoCommentBean> getReplyBeanList() {
        return replyBeanList == null ? new ArrayList<>() : replyBeanList;
    }

    public void setReplyBeanList(List<VideoCommentBean> replyBeanList) {
        this.replyBeanList = replyBeanList;
    }

    public void update_like(TextView textView) {
        textView.setText(like_text);
        Drawable top;
        if (is_like) {
            top = UiHelper.getDrawable(R.drawable.video_comment_like_select);
        } else {
            top = UiHelper.getDrawable(R.drawable.video_comment_like_no);
        }
        textView.setCompoundDrawablesWithIntrinsicBounds(null, top, null, null);
    }

    public VideoCommentBean(String content, String avatar, String nickname, String created_at, boolean is_newComment) {
        this.content = content;
        this.avatar = avatar;
        this.nickname = nickname;
        this.created_at = created_at;
        this.is_newComment = is_newComment;
    }

    public String getComment_id() {
        return this.comment_id;
    }

    public String getNickname() {
        return this.nickname;
    }

    public String getAvatar() {
        return this.avatar;
    }

    public String getContent() {
        return this.content;
    }

    public int getLike() {
        return this.like;
    }

    public int getReply() {
        return this.reply;
    }

    public String getCreated_at() {
        return this.created_at;
    }

    public String getLike_text() {
        return this.like_text;
    }

    public boolean is_like() {
        return this.is_like;
    }

    public boolean is_newComment() {
        return this.is_newComment;
    }

    public void setComment_id(String comment_id) {
        this.comment_id = comment_id;
    }

    public void setNickname(String nickname) {
        this.nickname = nickname;
    }

    public void setAvatar(String avatar) {
        this.avatar = avatar;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public void setLike(int like) {
        this.like = like;
    }

    public void setReply(int reply) {
        this.reply = reply;
    }

    public void setCreated_at(String created_at) {
        this.created_at = created_at;
    }

    public void setLike_text(String like_text) {
        this.like_text = like_text;
    }

    public void set_like(boolean is_like) {
        this.is_like = is_like;
    }

    public void set_newComment(boolean is_newComment) {
        this.is_newComment = is_newComment;
    }

    public boolean equals(final Object o) {
        if (o == this) return true;
        if (!(o instanceof VideoCommentBean)) return false;
        final VideoCommentBean other = (VideoCommentBean) o;
        if (!other.canEqual((Object) this)) return false;
        final Object this$comment_id = this.getComment_id();
        final Object other$comment_id = other.getComment_id();
        if (this$comment_id == null ? other$comment_id != null : !this$comment_id.equals(other$comment_id))
            return false;
        final Object this$nickname = this.getNickname();
        final Object other$nickname = other.getNickname();
        if (this$nickname == null ? other$nickname != null : !this$nickname.equals(other$nickname))
            return false;
        final Object this$avatar = this.getAvatar();
        final Object other$avatar = other.getAvatar();
        if (this$avatar == null ? other$avatar != null : !this$avatar.equals(other$avatar))
            return false;
        final Object this$content = this.getContent();
        final Object other$content = other.getContent();
        if (this$content == null ? other$content != null : !this$content.equals(other$content))
            return false;
        if (this.getLike() != other.getLike()) return false;
        if (this.getReply() != other.getReply()) return false;
        final Object this$created_at = this.getCreated_at();
        final Object other$created_at = other.getCreated_at();
        if (this$created_at == null ? other$created_at != null : !this$created_at.equals(other$created_at))
            return false;
        final Object this$like_text = this.getLike_text();
        final Object other$like_text = other.getLike_text();
        if (this$like_text == null ? other$like_text != null : !this$like_text.equals(other$like_text))
            return false;
        if (this.is_like() != other.is_like()) return false;
        if (this.is_newComment() != other.is_newComment()) return false;
        final Object this$replyBeanList = this.getReplyBeanList();
        final Object other$replyBeanList = other.getReplyBeanList();
        if (this$replyBeanList == null ? other$replyBeanList != null : !this$replyBeanList.equals(other$replyBeanList))
            return false;
        return true;
    }

    protected boolean canEqual(final Object other) {
        return other instanceof VideoCommentBean;
    }

    public int hashCode() {
        final int PRIME = 59;
        int result = 1;
        final Object $comment_id = this.getComment_id();
        result = result * PRIME + ($comment_id == null ? 43 : $comment_id.hashCode());
        final Object $nickname = this.getNickname();
        result = result * PRIME + ($nickname == null ? 43 : $nickname.hashCode());
        final Object $avatar = this.getAvatar();
        result = result * PRIME + ($avatar == null ? 43 : $avatar.hashCode());
        final Object $content = this.getContent();
        result = result * PRIME + ($content == null ? 43 : $content.hashCode());
        result = result * PRIME + this.getLike();
        result = result * PRIME + this.getReply();
        final Object $created_at = this.getCreated_at();
        result = result * PRIME + ($created_at == null ? 43 : $created_at.hashCode());
        final Object $like_text = this.getLike_text();
        result = result * PRIME + ($like_text == null ? 43 : $like_text.hashCode());
        result = result * PRIME + (this.is_like() ? 79 : 97);
        result = result * PRIME + (this.is_newComment() ? 79 : 97);
        final Object $replyBeanList = this.getReplyBeanList();
        result = result * PRIME + ($replyBeanList == null ? 43 : $replyBeanList.hashCode());
        return result;
    }

    public String toString() {
        return "VideoCommentBean(comment_id=" + this.getComment_id() + ", nickname=" + this.getNickname() + ", avatar=" + this.getAvatar() + ", content=" + this.getContent() + ", like=" + this.getLike() + ", reply=" + this.getReply() + ", created_at=" + this.getCreated_at() + ", like_text=" + this.getLike_text() + ", is_like=" + this.is_like() + ", is_newComment=" + this.is_newComment() + ", replyBeanList=" + this.getReplyBeanList() + ")";
    }
}
